/**  
 * @author renbangjie renbangjie@126.com  
 * @date 2014-12-26 上午11:06:59
 * @version V1.0  
 * <b>Copyright (c)</b> 2014医信金融信息服务（上海）有限公司-版权所有<br/>
 */
package com.yjd.comm.user.dto;

import com.yjd.comm.enums.GenderEnum;
import com.yjd.comm.user.model.AuthenAuditModel;
import com.yjd.comm.user.model.UserIdcardModel;
import com.yjd.comm.user.model.UserModel;
import com.yjd.comm.util.CardNoUtils;

/**
 * @author renbangjie renbangjie@126.com
 * @date 2014-12-26 上午11:06:59
 */
public class UserSession extends UserModel {

	/**
	 * @Fields serialVersionUID : TODO
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * 证件名称,当card_type为1的时候，该值为会员真实姓名
	 */
	private String idname;
	/**
	 * 类型，1：身份证
	 */
	private Integer card_type;
	/**
	 * 证件号码
	 */
	private String idcard;
	/**
	 * 性别
	 */
	private Integer sex;
	/**
	 * 生日
	 */
	private Long birthday;
	
	/**
	 * 生日
	 */
	private String birthdayFormmater;
	
	/**
	 * 性别
	 */
	private String gender;
	
	
	private Long lastMobileLoginTime; //终端最后登录日期
	
	private Long device_id; //设备表主键
	
	private String device_no; //设备编号
	
	private String device_name; //设备名称
	
	private Integer is_inuse; //设备使用状态
	
	/**
	 * 港澳台实名认证审核
	 */
	private AuthenAuditModel auditModel;
	
	
	public UserSession() {
	}

	public UserSession(UserModel uModel, UserIdcardModel ucModel) {
		super(uModel.getUser_id(), uModel.getUsername(), uModel.getEmail(),
				uModel.getMobile(), uModel.getEncrypt(), uModel.getPassword(),
				uModel.getPaypassword(), 
				uModel.getRegdate(), uModel.getLastdate(), uModel.getRegip(),
				uModel.getLastip(), uModel.getLoginnum(), uModel.getIslock(),
				uModel.getIs_prommotion_user(),uModel.getIs_user_card());
		this.idname = ucModel.getIdname();
		this.card_type = ucModel.getCard_type();
		this.idcard = ucModel.getIdcard();
		this.sex = ucModel.getSex();
		this.birthday = ucModel.getBirthday();
	}
	
	public String getIdname() {
		return idname;
	}

	public void setIdname(String idname) {
		this.idname = idname;
	}

	public Integer getCard_type() {
		return card_type;
	}

	public void setCard_type(Integer card_type) {
		this.card_type = card_type;
	}

	public String getIdcard() {
		return idcard;
	}

	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}

	public Integer getSex() {
		return sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	public Long getBirthday() {
		return birthday;
	}

	public void setBirthday(Long birthday) {
		this.birthday = birthday;
	}

	public String getGender() {
		return GenderEnum.parse(sex).getLabel();
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getBirthdayFormmater() {
		if(idcard != null){
			return CardNoUtils.getBirthday(idcard);
		}
		return birthdayFormmater;
	}

	public void setBirthdayFormmater(String birthdayFormmater) {
		this.birthdayFormmater = birthdayFormmater;
	}

	public Long getLastMobileLoginTime() {
		return lastMobileLoginTime;
	}

	public void setLastMobileLoginTime(Long lastMobileLoginTime) {
		this.lastMobileLoginTime = lastMobileLoginTime;
	}

	public Long getDevice_id() {
		return device_id;
	}

	public void setDevice_id(Long device_id) {
		this.device_id = device_id;
	}

	public String getDevice_no() {
		return device_no;
	}

	public void setDevice_no(String device_no) {
		this.device_no = device_no;
	}

	public String getDevice_name() {
		return device_name;
	}

	public void setDevice_name(String device_name) {
		this.device_name = device_name;
	}

	public Integer getIs_inuse() {
		return is_inuse;
	}

	public void setIs_inuse(Integer is_inuse) {
		this.is_inuse = is_inuse;
	}

	public AuthenAuditModel getAuditModel() {
		return auditModel;
	}

	public void setAuditModel(AuthenAuditModel auditModel) {
		this.auditModel = auditModel;
	}
	
}
